//====================================================
//
//		prefix
//
//====================================================

//字体大小
.prefix-font-size( @rem ) {
	font-size: unit( @rem/@rem2px, px );	//兼容不支持rem单位的浏览器
	font-size: unit( @rem, rem );
}

//边距和边框都将在已设定的宽度和高度内进行绘制
.prefix-box-sizing( @mode ) {
	-webkit-box-sizing: @mode;
	-moz-box-sizing: @mode;
	box-sizing:	@mode;
}

//圆角边框
//左上角
.prefix-border-top-left-radius(@angle) {
	-moz-border-top-left-radius: @angle;
	-webkit-border-top-left-radius: @angle;
	border-top-left-radius: @angle;
}
//右上角
.prefix-border-top-right-radius(@angle) {
	-moz-border-top-right-radius: @angle;
	-webkit-border-top-right-radius: @angle;
	border-top-right-radius: @angle;
}
//左下角
.prefix-border-bottom-left-radius(@angle) {
	-moz-border-bottom-left-radius:	@angle;
	-webkit-border-bottom-left-radius: @angle;
	border-bottom-left-radius: @angle;
}
//右下角
.prefix-border-bottom-right-radius(@angle) {
	-moz-border-bottom-right-radius: @angle;
	-webkit-border-bottom-right-radius:	@angle;
	border-bottom-right-radius:	@angle;
}
//上
.prefix-border-top-radius(@angle) {
	-moz-border-top-right-radius: @angle;
	-moz-border-top-left-radius: @angle;
	-webkit-border-top-right-radius: @angle;
	-webkit-border-top-left-radius: @angle;
	border-top-right-radius: @angle;
	border-top-left-radius: @angle;
}
//右
.prefix-border-right-radius(@angle) {
	-moz-border-bottom-right-radius: @angle;
	-moz-border-top-right-radius: @angle;
	-webkit-border-bottom-right-radius:	@angle;
	-webkit-border-top-right-radius: @angle;
	border-bottom-right-radius:	@angle;
	border-top-right-radius: @angle;
}
//下
.prefix-border-bottom-radius(@angle) {
	-moz-border-bottom-right-radius: @angle;
	-moz-border-bottom-left-radius:	@angle;
	-webkit-border-bottom-right-radius:	@angle;
	-webkit-border-bottom-left-radius:	@angle;
	border-bottom-right-radius:	@angle;
	border-bottom-left-radius:	@angle;
}
//左
.prefix-border-left-radius(@angle) {
	-moz-border-bottom-left-radius:	@angle;
	-moz-border-top-left-radius: @angle;
	-webkit-border-bottom-left-radius: @angle;
	-webkit-border-top-left-radius: @angle;
	border-bottom-left-radius: @angle;
	border-top-left-radius: @angle;
}
//全部
.prefix-border-radius(@angle) {
	-moz-border-radius: @angle;
	-webkit-border-radius: @angle;
	border-radius: @angle;
}

//半透明
.prefix-transition(@opt: all linear .15s) {
	-webkit-transition: @opt;
	-ms-transition: @opt;
	-moz-transition: @opt;
	transition: @opt;
}

//半透明
.prefix-opacity(@opacity) {
	-moz-opacity: @opacity;
	-khtml-opacity: @opacity;
	opacity: @opacity;
	// for IE
	@opacity-ie: (@opacity * 100);
	filter: ~"Alpha(Opacity=@{opacity-ie})";
}

//文本选取
// none：文本不能被选择
// text：可以选择文本
// all：当所有内容作为一个整体时可以被选择。如果双击或者在上下文上点击子元素，那么被选择的部分将是以该子元素向上回溯的最高祖先元素。
// element：可以选择文本，但选择范围受元素边界的约束
// IE6-9不支持该属性，但支持使用标签属性 onselectstart="return false;" 来达到 user-select:none 的效果；
.prefix-user-select(@mode:none) {
	-webkit-user-select: @mode;
	-moz-user-select: @mode;
	-ms-user-select: @mode;
	user-select: @mode;
}


//tab键切换焦点
.prefix-tabfocus() {
    // Default
    outline: thin dotted;
    // WebKit
    outline: 2px auto -webkit-focus-ring-color;
    outline-offset: -2px;

    outline: none;
}
//浏览器默认样式
.prefix-appearance(@mode:none) {
	// firefox
    -moz-appearance: @mode;
    // webkit
	-webkit-appearance: @mode;
}


//投影
// Drop shadows
//
// Note: Deprecated `.box-shadow()` as of v3.1.0 since all of Bootstrap's
// supported browsers that have box shadow capabilities now support it.
.prefix-box-shadow(@shadow:0 3px 10px 2px rgba(0,0,0,.05)) {
	-webkit-box-shadow: @shadow;	// iOS <4.3 & Android <4.1
	-ms-box-shadow: @shadow;		//IE11
	-moz-box-shadow: @shadow;		//firefox
	box-shadow: @shadow;
}



.prefix-keyframes (@name, @frames) {
    @-webkit-keyframes @name { @frames(); }
    @-moz-keyframes @name { @frames(); }
    @-ms-keyframes @name { @frames();}
    @-o-keyframes @name { @frames(); }
    @keyframes @name { @frames(); }
}
.prefix-transform(@attr) {
    -webkit-transform:@attr;
    -moz-transform:@attr;
    -o-transform:@attr;
    -ms-transform:@attr;
    transform:@attr;
}
.prefix-transformorigin(@attr) {
    -webkit-transform-origin:@attr;
    -moz-transform-origin:@attr;
    -o-transform-origin:@attr;
    -ms-transform-origin:@attr;
    transform-origin:@attr;
}
.prefix-animation(@attr){
    -webkit-animation:@attr;
    -moz-animation:@attr;
    -ms-animation:@attr;
    -o-animation:@attr;
    animation:@attr;
}
//线性渐变背景
.prefix-gradient(@attr){
  background: -webkit-linear-gradient(@attr);
  background: -moz-linear-gradient(@attr);
  background: -o-linear-gradient(@attr);
  background: linear-gradient(@attr);
}
//镜像渐变背景
.prefix-gradient-radial(@attr){
  background: -moz-radial-gradient(@attr);
  background: -webkit-radial-gradient(@attr);
}



.prefix-placeholder(@color: #999, @fontsize: 14px) {
    &::-webkit-input-placeholder {      /* WebKit browsers */
        color: @color;
        font-size: @fontsize;
    }
    &:-moz-placeholder {                /* Mozilla Firefox 4 to 18 */
        color: @color;
        font-size: @fontsize;
        opacity: 1;  //Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526
    }
    &::-moz-placeholder {               /* Mozilla Firefox 19+ */
        color: @color;
        font-size: @fontsize;
        opacity: 1;
    }
    &:-ms-input-placeholder {           /* Internet Explorer 10+ */
        color: @color;
        font-size: @fontsize;
    }
}
